Note: You should set an upper limit on the number of EODatabaseChannels your application registers with an EODatabaseContext. It's very unusual for an EODatabaseContext to require more than two or three EODatabaseChannels.
The following code examples demonstrate creating a new EODatabaseChannel and registering it with an EODatabaseContext:
EODatabaseContext context; // Assume this existsIn Objective-C:
EODatabaseChannel channel = new EODatabaseChannel(context);
if (channel) context.registerChannel(channel);
EODatabaseContext *context; // Assume this existsThe EODatabaseChannel constructor can return null if no more channels can be associated with the EODatabaseContext. Similarly, in Objective-C, the EODatabaseChannel method initWithDatabaseContext: can return nil if no more channels can be associated with the EODatabaseContext. Some database servers and their corresponding adaptors don't support multiple channels per context. For example, the Sybase adaptor only supports one EODatabaseChannel per EODatabaseContext.
EODatabaseChannel *channel = [[EODatabaseChannel alloc]
initWithDatabaseContext:context];
if (channel) [context registerChannel:channel];
Table of Contents
Next Section